#ifndef __OBJECT_HPP__
#define __OBJECT_HPP__

extern "C" {
#include <glib-object.h>
#include <gtk/gtk.h>
}

namespace gtkhpp {

class Object {
public:
    typedef GCallback Callback;
    Object() {}
    void connect(const char *signal, Callback c_handler, void *data);
    void *object() { return obj; }
protected:
    Object(Object *parent) { if(parent) delete parent; }
    GObject *obj;
};

inline void Object::connect(const char *signal, Callback c_handler, void *data)
{
    g_signal_connect_data ((void *)obj, signal, c_handler, data, NULL, (GConnectFlags) 0);

}

} // namespace gtkhpp

#endif /* end of include guard */
